<template>
  <div class="shop-app">
    <div class="shop-app-body">
      <div class="shop-app-icon">
        <i :class="icon" :style="{ color: iconColor }" />
        <div @click="$emit('install',id)">
          安装
        </div>
      </div>
      <div class="shop-app-text">
        <div class="shop-app-name">{{ name }}</div>
        <div class="shop-app-context">
          <span>{{ context }}</span>
        </div>
      </div>
    </div>
    <div class="shop-app-bar">
      <span class="shop-app-bar-title">适用范围:</span>
      <span class="shop-app-bar-tag" v-for="(tag, i) in tags" :key="i">{{
        tag
      }}</span>
    </div>
    <div class="shop-app-ev">
      <div class="black"/>
      <div class="shop-app-ev-btn">
        <i class="iconfont icon-low" @click="$emit('eval',id,-1)"/><span>踩:{{ low }}</span>
      </div>
      <div class="shop-app-ev-btn" @click="$emit('eval',id,1)">
        <i class="iconfont icon-love" /><span>赞:{{ love }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  model:{
    methods:['eval','install']
  },
  props: {
    id:{type:String,required:true},
    name: { type: String, default: "测试名称" },
    icon: { type: String, default: "el-icon-setting" },
    iconColor: { type: String, default: "#409eff" },
    context: { type: String, default: "还在赶稿中🤓..." },
    love: { type: Number, default: 0 },
    low: { type: Number, default: 0 },
    tags: { type: Array, default: () => ["全体民警"] },
  },
};
</script>

<style lang="less" scoped>
.shop-app {
  width: 100%;
  height: 155px;
  background-color: #fff;
  margin: 5px;
  border-radius: 5px;
  padding: 10px;
  color: #606266;
  border:#409eff solid 1px;
}
.shop-app:hover {
  box-shadow: #c0c4cc 0px 0px 5px 3px;
}
.shop-app-body {
  display: flex;
  height: 110px;
}
.shop-app-bar {
  height: 25px;
  line-height: 25px;
  font-size: 12px;
  padding-top: 5px;
  overflow: hidden;
}
.shop-app-bar-title {
  font-weight: bold;
  margin-right: 10px;
  color: #909399;
}
.shop-app-bar-tag {
  font-size: 12px;
  background-color: #409eff;
  padding: 0 10px;
  border-radius: 10px;
  color: #fff;
  height: 20px;
  line-height: 20px;
  margin-top: 10px;
  margin-right: 5px;
}
.shop-app-icon {
  justify-content: start;
  width: 60px;
  flex: 0 0 60px;
  text-align: center;
  i {
    font-size: 40px;
    margin: 15px 0;
  }
  div {
    background-color: #67C23A;
    width: fit-content;
    padding:2px 10px;
    cursor: pointer;
    border-radius: 5px;
    color:#fff;
    font-size: 13px;
    margin-left: 5px;
    margin-top:10px;
  }
  div:hover {
    background-color: rgb(121, 187, 255);
  }
}
.shop-app-text {
  width: 290px;
  flex: 0 0 290px;
  justify-content: end;
  overflow: hidden;
}
.shop-app-name {
  height: 30px;
  font-size: 18px;
  color: #303133;
  line-height: 30px;
}
.shop-app-context {
  font-size: 12px;
  border: rgb(198, 226, 255) solid 1px;
  border-radius: 3px;
  height: 68px;
  padding: 5px;
}
.shop-app-ev {
  width:100%;
  overflow: hidden;
  display: flex;
  text-align: center;
}
.shop-app-ev-btn {
    i {
      font-size: 20px;
      margin-right:3px;
      font-weight: bold;
      cursor: pointer;
    }
    width:100px;
    flex:0 0 100px;
    justify-content: end;
    color: #409eff;
    font-size: 12px;
    height: 20px;
    line-height: 20px;
}
.black {
    width:100%;
    justify-content: start;
  }
</style>
